package day05;

public class Test05 {
    public static void main(String[] args) {
        int[] array = {5,5};
        int Max = (int) getMax(array);
        System.out.println("该数组的最大值是："+Max);
    }
        public static double getMax(int[] arr){
            int Max = 0;
            int sum = 0;
            //遍历数组求和
            for(int i = 0;i<arr.length;i++){
                if(sum<=arr[i]){
                    sum =arr[i] ;
                }
            }
            System.out.println();
            Max = sum;
            return Max;
        }
}
